package com.train.service.impl;

import com.train.dto.CardDTO;
import com.train.mapper.CardMapper;
import com.train.pojo.Card;
import com.train.service.CardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CardServiceImpl implements CardService {
    @Autowired
    private CardMapper cardMapper;

    @Override
    public List<CardDTO> selectAllCardDTO() {
        return cardMapper.selectAllCardDTO();
    }

    @Override
    public CardDTO selectCardDTOByCardid(String cardid) {
        return cardMapper.selectCardDTOByCardid(cardid);
    }

    @Override
    public Card selectCardByCardid(String cardid) {
        return cardMapper.selectCardByCardid(cardid);
    }

    @Override
    public Card selectCardByStr(String str) {
        return cardMapper.selectCardByStr(str);
    }

    @Override
    public int addCard(Card card) {

        return cardMapper.addCard(card);
    }

    @Override
    public int updateCard(Card card) {
        return cardMapper.updateCard(card);
    }

    @Override
    public int deleteCard(String cardid) {
        return cardMapper.deleteCard(cardid);
    }
}
